<?php
	include_once("Login.php");
	
	$conn = new mysqli($host,$user,$passwd, $database)
	or die("SQL connect error: ".mysqli_connect_error());
	
	$body = file_get_contents('php://input');
	$xml = simplexml_load_string($body);

	$toUserId = $xml->toUserId;
	$fromUserId = $xml->fromUserId;
	$message = $xml->message;
	$query = "INSERT INTO Message (FromUserId, ToUserId, Message, DateSent) VALUES ('$fromUserId', '$toUserId', '$message', Now())";
	
	mysqli_query($conn, $query);
	
	$id =  mysqli_insert_id($conn);
		
	mysqli_close($conn);
?>